﻿using System;
using System.Text.RegularExpressions;

namespace Bookworm.Core
{
    [Serializable]
    public abstract class TextFrame : Frame
    {
        private string _value;

        [FrameData(Order = 0)]
        public string Value
        {
            get { return _value; }
            set
            {
                if (Format != null && !Format.IsMatch(value))
                    return;
                _value = value;
            }
        }

        protected virtual Regex Format
        {
            get { return null; }
        }
    }
}
